using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Microsoft.Office.Interop.Excel;
using ZedGraph;

namespace ICP_MS.Plugin.LA300;

public class FormScan : Form
{
	private ExperimentDatas experiment = null;

	private ExperimentDB db = null;

	private List<IntegerRegions> regions = new List<IntegerRegions>();

	private IsotopeInfos selectIsotope = null;

	private int SelectMains = -1;

	private SamplesInfos selectSample = null;

	private Dictionary<string, Color> DicSymbolColors = new Dictionary<string, Color>();

	private List<Color> colors = new List<Color>
	{
		Color.Red,
		Color.Blue,
		Color.Gold,
		Color.Green,
		Color.Black,
		Color.Orange,
		Color.Purple,
		Color.Magenta,
		Color.DarkSlateBlue,
		Color.Lime
	};

	private List<GraphPane> paneList = new List<GraphPane>();

	private IContainer components = null;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn13;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn14;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn16;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn17;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn18;

	private SplitContainer splitContainer1;

	private Panel panel1;

	private CustomGraph customGraph1;

	private GroupBox groupBox1;

	private TreeView treeView1;

	private GroupBox groupBox2;

	private DbufferGrid dgvRegions;

	private TableLayoutPanel tableLayoutPanel1;

	private GroupBox groupBox3;

	private DataGridView dgvPeak;

	private DataGridViewTextBoxColumn colSymbol;

	private DataGridViewTextBoxColumn colDwell;

	private DataGridViewTextBoxColumn colResolution;

	private DbufferGrid dgvSample;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn19;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn20;

	private DataGridViewTextBoxColumn colSweeps;

	private SplitContainer splitContainer3;

	private FlowLayoutPanel pnlColor;

	private DataGridViewTextBoxColumn colLabel;

	private DataGridViewTextBoxColumn ColMains;

	private DataGridViewTextBoxColumn colStart;

	private DataGridViewTextBoxColumn colEnd;

	private DataGridViewTextBoxColumn colReference;

	public FormScan()
	{
		InitializeComponent();
	}

	public void SetParams(ExperimentDatas experiment, ExperimentDB db)
	{
		this.experiment = experiment;
		this.db = db;
	}

	private void FormScan_Load(object sender, EventArgs e)
	{
		ApplyResources();
		base.WindowState = FormWindowState.Maximized;
		GraphPane pane = customGraph1.GraphPane;
		pane.Legend.Position = LegendPos.Right;
		pane.Title.Text = "";
		pane.XAxis.Title.Text = "time";
		pane.XAxis.Scale.Min = 0.0;
		pane.XAxis.Scale.Max = 300.0;
		pane.YAxis.Title.Text = "cps";
		pane.AxisChange();
		customGraph1.Refresh();
		experiment_isotopeChanged(null, null);
		experiment_sampleChanged(null, null);
		experiment.SingleAcq += experiment_SingleAcq;
		experiment.EventExperiment += experiment_EventExperiment;
		experiment.isotopeChanged += experiment_isotopeChanged;
		experiment.sampleChanged += experiment_sampleChanged;
	}

	private void ApplyResources()
	{
		groupBox3.Text = Lang.Txt("FormScanLA.Scanparameter");
		colSymbol.HeaderText = Lang.Txt("FormScanLA.Element");
		colDwell.HeaderText = Lang.Txt("FormScanLA.Dwell");
		colResolution.HeaderText = Lang.Txt("FormScanLA.Resolution");
		groupBox1.Text = Lang.Txt("FormScanLA.SampleAndElement");
		groupBox2.Text = Lang.Txt("FormScanLA.Integral");
		colLabel.HeaderText = Lang.Txt("FormScanLA.Label");
		ColMains.HeaderText = Lang.Txt("FormScanLA.ScanTimes");
		colStart.HeaderText = Lang.Txt("FormScanLA.Start");
		colEnd.HeaderText = Lang.Txt("FormScanLA.End");
		colReference.HeaderText = Lang.Txt("FormScanLA.Reference");
		dataGridViewTextBoxColumn19.HeaderText = Lang.Txt("FormScanLA.SampleName");
		dataGridViewTextBoxColumn20.HeaderText = Lang.Txt("FormScanLA.SampleTime");
		colSweeps.HeaderText = Lang.Txt("FormScanLA.Sweeps");
	}

	private void experiment_SingleAcq(object sender, CurveInfoEventArgs e)
	{
		UpdateCurves(e.SampleId, e.RunIndex);
	}

	private void experiment_EventExperiment(object sender, ExperimentEventArgs e)
	{
		if (e.StepIndex != 0)
		{
			return;
		}
		SamplesInfos sample = e.Sample;
		foreach (TreeNode node in treeView1.Nodes)
		{
			if (node.Tag == sample)
			{
				Invoke((MethodInvoker)delegate
				{
					treeView1.SelectedNode = node;
				});
				break;
			}
		}
	}

	private void experiment_isotopeChanged(object sender, EventArgs e)
	{
		UpdatePeakJumpRegions(null, null);
		SetSampleIsotopes();
	}

	private void experiment_sampleChanged(object sender, EventArgs e)
	{
		SetSampleIsotopes();
		RebindAcqTime();
	}

	private void FormScan_FormClosing(object sender, FormClosingEventArgs e)
	{
		experiment.sampleChanged -= experiment_sampleChanged;
		experiment.isotopeChanged -= experiment_isotopeChanged;
		experiment.SingleAcq -= experiment_SingleAcq;
		experiment.EventExperiment -= experiment_EventExperiment;
	}

	private void RebindPeakData()
	{
		experiment.PeakRegions.Sort((PeakRegions r1, PeakRegions r2) => r1.mass.CompareTo(r2.mass));
		dgvPeak.AutoGenerateColumns = false;
		if (dgvPeak.DataSource == null)
		{
			dgvPeak.DataSource = experiment.PeakRegions;
			return;
		}
		BindingContext[dgvPeak.DataSource].SuspendBinding();
		dgvPeak.DataSource = null;
		dgvPeak.DataSource = experiment.PeakRegions;
		BindingContext[dgvPeak.DataSource].ResumeBinding();
	}

	private void RebindAcqTime()
	{
		((DataGridView)(object)dgvSample).AutoGenerateColumns = false;
		if (((DataGridView)(object)dgvSample).DataSource == null)
		{
			((DataGridView)(object)dgvSample).DataSource = experiment.AcqTimes;
			return;
		}
		BindingContext[((DataGridView)(object)dgvSample).DataSource].SuspendBinding();
		((DataGridView)(object)dgvSample).DataSource = null;
		((DataGridView)(object)dgvSample).DataSource = experiment.AcqTimes;
		BindingContext[((DataGridView)(object)dgvSample).DataSource].ResumeBinding();
	}

	private void SetPeakJumpRegions()
	{
		List<PeakRegions> removeregions = new List<PeakRegions>();
		foreach (PeakRegions peakregion2 in experiment.PeakRegions)
		{
			if (experiment.Isotopes.Find((IsotopeInfos isotope) => isotope.mass == peakregion2.mass) == null)
			{
				removeregions.Add(peakregion2);
			}
		}
		for (int i = 0; i < removeregions.Count; i++)
		{
			experiment.PeakRegions.Remove(removeregions[i]);
		}
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (experiment.PeakRegions.Find((PeakRegions peakregion) => peakregion.symbol == isotope2.symbol) == null)
			{
				if (experiment.PeakRegions.Count > 0)
				{
					experiment.PeakRegions.Add(new PeakRegions(isotope2.symbol, isotope2.mass, experiment.PeakRegions[0].dwell, experiment.PeakRegions[0].channels));
				}
				else
				{
					experiment.PeakRegions.Add(new PeakRegions(isotope2.symbol, isotope2.mass));
				}
			}
		}
		experiment.PeakRegions.Sort((PeakRegions a, PeakRegions b) => a.mass.CompareTo(b.mass));
	}

	private void UpdatePeakJumpRegions(object sender, EventArgs e)
	{
		SetPeakJumpRegions();
		RebindPeakData();
	}

	private void RebindIntegRegions()
	{
		((DataGridView)(object)dgvRegions).AutoGenerateColumns = false;
		if (((DataGridView)(object)dgvRegions).DataSource == null)
		{
			((DataGridView)(object)dgvRegions).DataSource = regions;
			return;
		}
		BindingContext[((DataGridView)(object)dgvRegions).DataSource].SuspendBinding();
		((DataGridView)(object)dgvRegions).DataSource = null;
		((DataGridView)(object)dgvRegions).DataSource = regions;
		BindingContext[((DataGridView)(object)dgvRegions).DataSource].ResumeBinding();
	}

	private string GetSampleNames(string name, int mains)
	{
		return name.ToString() + ":Run[" + mains + "]";
	}

	private void SetSampleIsotopes()
	{
		SetSymbolColor();
		treeView1.Nodes.Clear();
		treeView1.Nodes.Add("<None>");
		foreach (SamplesInfos sample in experiment.Samples)
		{
			TreeNode node = treeView1.Nodes.Add(sample.label);
			node.Tag = sample;
			for (int i = 0; i < sample.mains; i++)
			{
				TreeNode snode = node.Nodes.Add((i + 1).ToString());
				snode.Tag = i + 1;
				foreach (IsotopeInfos isotope in experiment.Isotopes)
				{
					TreeNode subNode = snode.Nodes.Add(isotope.symbol);
					subNode.Tag = isotope;
				}
			}
		}
		pnlColor.Controls.Clear();
		foreach (KeyValuePair<string, Color> dic in DicSymbolColors)
		{
			ColorCntl control = new ColorCntl(dic.Key, dic.Value);
			control.ColorChanged += control_ColorChanged;
			control.Click += control_Click;
			pnlColor.Controls.Add(control);
		}
	}

	private void control_Click(object sender, EventArgs e)
	{
		foreach (ColorCntl control in pnlColor.Controls)
		{
			control.BackColor = Color.FromKnownColor(KnownColor.Control);
		}
		ColorCntl colorcontrol = sender as ColorCntl;
		colorcontrol.BackColor = Color.LightBlue;
		pnlColor.Refresh();
		string symbol = (sender as ColorCntl).Symbol;
		int index = customGraph1.GraphPane.CurveList.FindIndex((CurveItem r) => Convert.ToString(r.Tag) == symbol);
		for (int i = 0; i < customGraph1.GraphPane.CurveList.Count; i++)
		{
			if (i != index)
			{
				LineItem line = customGraph1.GraphPane.CurveList[i] as LineItem;
				line.Line.Width = 1f;
			}
			else
			{
				LineItem line2 = customGraph1.GraphPane.CurveList[index] as LineItem;
				line2.Line.Width = 3f;
			}
		}
		customGraph1.Refresh();
	}

	private void control_MouseClick(object sender, MouseEventArgs e)
	{
		string symbol = (sender as ColorCntl).Symbol;
		int index = customGraph1.GraphPane.CurveList.FindIndex((CurveItem r) => Convert.ToString(r.Tag) == symbol);
		for (int i = 0; i < customGraph1.GraphPane.CurveList.Count; i++)
		{
			if (i != index)
			{
				LineItem line = customGraph1.GraphPane.CurveList[i] as LineItem;
				line.Line.Width = 1f;
			}
			else
			{
				LineItem line2 = customGraph1.GraphPane.CurveList[index] as LineItem;
				line2.Line.Width = 3f;
			}
		}
		customGraph1.Refresh();
	}

	public void control_ColorChanged(object sender, EventArgs e)
	{
		string symbol = (sender as ColorCntl).Symbol;
		Color color = (sender as ColorCntl).color;
		DicSymbolColors[symbol] = color;
	}

	private void SetSymbolColor()
	{
		int colorCount = 0;
		int total = colors.Count();
		DicSymbolColors.Clear();
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			colorCount++;
			DicSymbolColors.Add(isotope.symbol, colors[(colorCount - 1) % total]);
		}
	}

	private void rdbtnIsotope_CheckedChanged(object sender, EventArgs e)
	{
		SetSampleIsotopes();
		treeView1.SelectedNode = treeView1.Nodes[0];
	}

	private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
	{
		if (e.Node.Equals(treeView1.Nodes[0]))
		{
			selectSample = null;
			selectIsotope = null;
			SelectMains = -1;
		}
		else if (e.Node.Level == 0)
		{
			selectIsotope = null;
			selectSample = e.Node.Tag as SamplesInfos;
			SelectMains = -1;
		}
		else if (e.Node.Level == 1)
		{
			selectSample = e.Node.Parent.Tag as SamplesInfos;
			SelectMains = (int)e.Node.Tag;
		}
		else
		{
			selectSample = e.Node.Parent.Parent.Tag as SamplesInfos;
			SelectMains = (int)e.Node.Parent.Tag;
			selectIsotope = e.Node.Tag as IsotopeInfos;
		}
		SetNodeColor(treeView1.Nodes, e.Node);
		SetIntegRegion();
		SetupCurves();
		UpdateCurves();
	}

	private void SetNodeColor(TreeNodeCollection nodes, TreeNode destNode)
	{
		foreach (TreeNode child in nodes)
		{
			if (child.Equals(destNode))
			{
				child.BackColor = Color.FromKnownColor(KnownColor.Highlight);
			}
			else
			{
				child.BackColor = Color.White;
			}
			if (child.Nodes.Count > 0)
			{
				SetNodeColor(child.Nodes, destNode);
			}
		}
	}

	private void SetIntegRegion()
	{
		regions.Clear();
		if (selectSample != null)
		{
			if (SelectMains >= 0)
			{
				IEnumerable<IntegerRegions> tRegions = experiment.IntegerRegions.Where((IntegerRegions region) => region.SampleId == selectSample.guid && region.Mains == SelectMains);
				if (tRegions.Any())
				{
					regions.AddRange(tRegions);
				}
			}
			else
			{
				IEnumerable<IntegerRegions> tRegions2 = experiment.IntegerRegions.Where((IntegerRegions region) => region.SampleId == selectSample.guid);
				if (tRegions2.Any())
				{
					regions.AddRange(tRegions2);
				}
			}
		}
		RebindIntegRegions();
		UpdateRegionGraph();
	}

	private void UpdateRegionGraph()
	{
		if (SelectMains != -1)
		{
			customGraph1.SetRegions(regions.ToArray());
			customGraph1.Refresh();
		}
	}

	private void dgvRegions_MouseDown(object sender, MouseEventArgs e)
	{
		if (e.Button != MouseButtons.Right || selectSample == null)
		{
			return;
		}
		if (SelectMains == -1)
		{
			ContextMenu menu = new ContextMenu();
			menu.MenuItems.Add(Lang.Txt("FormScanLA.Add"), delegate
			{
				for (int i = 1; i <= selectSample.mains; i++)
				{
					IntegerRegions integerRegions2 = new IntegerRegions
					{
						Start = 0,
						End = 10,
						Label = "RW-00"
					};
					integerRegions2.SampleId = selectSample.guid;
					integerRegions2.Mains = i;
					regions.Add(integerRegions2);
					experiment.IntegerRegions.Add(integerRegions2);
				}
				experiment.Dirty.InterRegionDirty = true;
				RebindIntegRegions();
			});
			menu.MenuItems.Add(Lang.Txt("FormScanLA.Delete"), delegate
			{
				List<IntegerRegions> list2 = new List<IntegerRegions>();
				foreach (DataGridViewRow dataGridViewRow2 in ((DataGridView)(object)dgvRegions).SelectedRows)
				{
					list2.Add(regions[dataGridViewRow2.Index]);
				}
				foreach (IntegerRegions current2 in list2)
				{
					experiment.IntegerRegions.Remove(current2);
					regions.Remove(current2);
				}
				experiment.Dirty.InterRegionDirty = true;
				list2.Clear();
				list2 = null;
				RebindIntegRegions();
			});
			menu.Show((Control)(object)dgvRegions, e.Location);
			return;
		}
		ContextMenu menu2 = new ContextMenu();
		menu2.MenuItems.Add(Lang.Txt("FormScanLA.Add"), delegate
		{
			IntegerRegions integerRegions = new IntegerRegions
			{
				Start = 0,
				End = 10,
				Label = "RW-00"
			};
			integerRegions.SampleId = selectSample.guid;
			integerRegions.Mains = SelectMains;
			experiment.IntegerRegions.Add(integerRegions);
			regions.Add(integerRegions);
			experiment.Dirty.InterRegionDirty = true;
			RebindIntegRegions();
			UpdateRegionGraph();
		});
		menu2.MenuItems.Add(Lang.Txt("FormScanLA.Delete"), delegate
		{
			List<IntegerRegions> list = new List<IntegerRegions>();
			foreach (DataGridViewRow dataGridViewRow in ((DataGridView)(object)dgvRegions).SelectedRows)
			{
				list.Add(regions[dataGridViewRow.Index]);
			}
			foreach (IntegerRegions current in list)
			{
				experiment.IntegerRegions.Remove(current);
				regions.Remove(current);
			}
			experiment.Dirty.InterRegionDirty = true;
			list.Clear();
			list = null;
			RebindIntegRegions();
		});
		menu2.Show((Control)(object)dgvRegions, e.Location);
	}

	private void dgvRegions_CellValueChanged(object sender, DataGridViewCellEventArgs e)
	{
		if (e.RowIndex >= 0)
		{
			int columnIndex = e.ColumnIndex;
			int num = columnIndex;
			if ((uint)(num - 2) <= 1u)
			{
				UpdateRegionGraph();
			}
			experiment.Dirty.InterRegionDirty = true;
		}
	}

	private void SetupCurves()
	{
		if (selectSample == null || SelectMains == -1)
		{
			return;
		}
		GraphPane pane = customGraph1.GraphPane;
		pane.Title.Text = selectSample.label;
		pane.Title.Text = $"{selectSample.label}--[{SelectMains.ToString()}]";
		pane.XAxis.Title.Text = "time";
		pane.XAxis.Scale.Min = 0.0;
		pane.XAxis.Scale.Max = 10.0;
		pane.YAxis.Title.Text = "cps";
		pane.Legend.FontSpec.Size = 9f;
		pane.Legend.IsVisible = false;
		pane.IsFontsScaled = true;
		pane.CurveList.Clear();
		if (selectIsotope != null)
		{
			LineItem line = pane.AddCurve(selectIsotope.symbol, new PointPairList(), Color.Red, SymbolType.None);
			line.Tag = selectIsotope.symbol;
			line.Line.Width = 1f;
		}
		else
		{
			foreach (KeyValuePair<string, Color> dic in DicSymbolColors)
			{
				LineItem line2 = pane.AddCurve(dic.Key, new PointPairList(), dic.Value, SymbolType.None);
				line2.Tag = dic.Key;
				line2.Line.Width = 1f;
			}
		}
		pane.AxisChange();
		customGraph1.Refresh();
	}

	private void ExportSpectrum(int sampleIdx, int runIdx)
	{
		if (selectSample == null || SelectMains == -1 || selectSample.guid != sampleIdx || selectSample.mains <= runIdx)
		{
			return;
		}
		string FileName = "";
		SaveFileDialog saveFileDialog = new SaveFileDialog();
		saveFileDialog.DefaultExt = "xlsx";
		saveFileDialog.Filter = "Excel文件|*.xlsx";
		if (saveFileDialog.ShowDialog() != DialogResult.OK)
		{
			return;
		}
		FileName = saveFileDialog.FileName;
		string fileName = Path.GetFileNameWithoutExtension(FileName);
		if (FileName.IndexOf(":") < 0)
		{
			return;
		}
		Microsoft.Office.Interop.Excel.Application xlApp = (Microsoft.Office.Interop.Excel.Application)Activator.CreateInstance(Marshal.GetTypeFromCLSID(new Guid("00024500-0000-0000-C000-000000000046")));
		if (xlApp == null)
		{
			MessageBox.Show(Lang.Txt("FormScanLA.Text1"));
			return;
		}
		Workbooks workbooks = xlApp.Workbooks;
		Workbook workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet);
		object misValue = Missing.Value;
		Worksheet worksheet = (Worksheet)(dynamic)workbook.Worksheets[1];
		worksheet.Name = "DefaultSheet";
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			IEnumerable<TimeSpectrum> spectrums = experiment.TimeSpectrums.Where((TimeSpectrum spectrum) => spectrum.SampleId == selectSample.guid && spectrum.Symbol == isotope.symbol && spectrum.RunIndex == runIdx && spectrum.isTest);
			if (!spectrums.Any())
			{
				continue;
			}
			TimeSpectrum spectrum2 = spectrums.First();
			lock (spectrum2)
			{
				worksheet = (Worksheet)(dynamic)workbook.Worksheets.Add(worksheet, misValue, misValue, misValue);
				worksheet.Name = isotope.symbol;
				for (int i = 0; i < spectrum2.Time.Count(); i++)
				{
					worksheet.Cells[1 + i, 1] = spectrum2.Time[i];
					worksheet.Cells[1 + i, 2] = spectrum2.Intensity[i];
				}
				worksheet.Columns.EntireColumn.AutoFit();
			}
		}
		if (FileName != "")
		{
			try
			{
				workbook.Saved = true;
				workbook.SaveCopyAs(FileName);
			}
			catch (Exception ex)
			{
				MessageBox.Show(Lang.Txt("FormScanLA.Text2") + "\n" + ex.Message);
				xlApp.Quit();
				GC.Collect();
				return;
			}
		}
		xlApp.Quit();
		GC.Collect();
		Process.Start(FileName);
	}

	private void UpdateCurves(int sampleIdx, int runIdx)
	{
		if (selectSample == null || selectSample.guid != sampleIdx || selectSample.mains <= runIdx)
		{
			return;
		}
		GraphPane pane = customGraph1.GraphPane;
		foreach (IsotopeInfos isotope in experiment.Isotopes)
		{
			CurveItem lineItem = pane.CurveList.Find((CurveItem line) => line.Tag.Equals(isotope.symbol));
			if (lineItem == null)
			{
				continue;
			}
			IEnumerable<TimeSpectrum> spectrums = experiment.TimeSpectrums.Where((TimeSpectrum spectrum) => spectrum.SampleId == selectSample.guid && spectrum.Symbol == isotope.symbol && spectrum.RunIndex == runIdx && spectrum.isTest);
			if (!spectrums.Any())
			{
				continue;
			}
			TimeSpectrum spectrum2 = spectrums.First();
			lock (spectrum2)
			{
				lineItem.Points = new PointPairList(spectrum2.Time.ToArray(), spectrum2.Intensity.ToArray());
				if (spectrum2.Time.Count() > 0 && spectrum2.Time.Max() > customGraph1.GraphPane.XAxis.Scale.Max)
				{
					customGraph1.GraphPane.XAxis.Scale.Max = spectrum2.Time.Max();
				}
			}
		}
		pane.AxisChange();
		Invoke((MethodInvoker)delegate
		{
			customGraph1.Refresh();
		});
	}

	private void UpdateCurves()
	{
		if (SelectMains != -1)
		{
			UpdateCurves(selectSample.guid, SelectMains - 1);
		}
	}

	private void customGraph1_MouseDoubleClick(object sender, MouseEventArgs e)
	{
		MasterPane masterPane = customGraph1.MasterPane;
		GraphPane pane = masterPane.FindPane(e.Location);
		if (pane == null)
		{
		}
	}

	private void dgvRegions_DataError(object sender, DataGridViewDataErrorEventArgs e)
	{
		if (((DataGridView)(object)dgvRegions).IsCurrentCellDirty)
		{
			((DataGridView)(object)dgvRegions).CommitEdit(DataGridViewDataErrorContexts.Commit);
		}
	}

	private void treeView1_MouseClick(object sender, MouseEventArgs e)
	{
		if (e.Button != MouseButtons.Right)
		{
			return;
		}
		ContextMenu contextMenu = new ContextMenu();
		contextMenu.MenuItems.Add(Lang.Txt("FormScanLA.Text3"), delegate
		{
			TreeNode selectedNode = treeView1.SelectedNode;
			if (selectedNode.Equals(treeView1.Nodes[0]))
			{
				selectSample = null;
				selectIsotope = null;
				SelectMains = -1;
			}
			else if (selectedNode.Level == 0)
			{
				selectIsotope = null;
				selectSample = selectedNode.Tag as SamplesInfos;
				SelectMains = -1;
			}
			else if (selectedNode.Level == 1)
			{
				selectSample = selectedNode.Parent.Tag as SamplesInfos;
				SelectMains = (int)selectedNode.Tag;
			}
			else
			{
				selectSample = selectedNode.Parent.Parent.Tag as SamplesInfos;
				SelectMains = (int)selectedNode.Parent.Tag;
				selectIsotope = selectedNode.Tag as IsotopeInfos;
			}
			ExportSpectrum(selectSample.guid, SelectMains - 1);
		});
		contextMenu.Show(treeView1, e.Location);
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Expected O, but got Unknown
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Expected O, but got Unknown
		this.components = new System.ComponentModel.Container();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
		this.splitContainer1 = new System.Windows.Forms.SplitContainer();
		this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
		this.groupBox2 = new System.Windows.Forms.GroupBox();
		this.dgvRegions = new DbufferGrid();
		this.colLabel = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ColMains = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colStart = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colEnd = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colReference = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.groupBox3 = new System.Windows.Forms.GroupBox();
		this.dgvPeak = new System.Windows.Forms.DataGridView();
		this.colSymbol = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colDwell = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colResolution = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.groupBox1 = new System.Windows.Forms.GroupBox();
		this.splitContainer3 = new System.Windows.Forms.SplitContainer();
		this.treeView1 = new System.Windows.Forms.TreeView();
		this.pnlColor = new System.Windows.Forms.FlowLayoutPanel();
		this.panel1 = new System.Windows.Forms.Panel();
		this.dgvSample = new DbufferGrid();
		this.dataGridViewTextBoxColumn19 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn20 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colSweeps = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.customGraph1 = new ICP_MS.Plugin.LA300.CustomGraph();
		this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn14 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn15 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn16 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn17 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn18 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		((System.ComponentModel.ISupportInitialize)this.splitContainer1).BeginInit();
		this.splitContainer1.Panel1.SuspendLayout();
		this.splitContainer1.Panel2.SuspendLayout();
		this.splitContainer1.SuspendLayout();
		this.tableLayoutPanel1.SuspendLayout();
		this.groupBox2.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvRegions).BeginInit();
		this.groupBox3.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvPeak).BeginInit();
		this.groupBox1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.splitContainer3).BeginInit();
		this.splitContainer3.Panel1.SuspendLayout();
		this.splitContainer3.Panel2.SuspendLayout();
		this.splitContainer3.SuspendLayout();
		this.panel1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvSample).BeginInit();
		base.SuspendLayout();
		this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.splitContainer1.Location = new System.Drawing.Point(0, 0);
		this.splitContainer1.Name = "splitContainer1";
		this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
		this.splitContainer1.Panel1.Controls.Add(this.tableLayoutPanel1);
		this.splitContainer1.Panel2.Controls.Add(this.panel1);
		this.splitContainer1.Size = new System.Drawing.Size(956, 584);
		this.splitContainer1.SplitterDistance = 293;
		this.splitContainer1.TabIndex = 0;
		this.tableLayoutPanel1.ColumnCount = 3;
		this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333f));
		this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333f));
		this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333f));
		this.tableLayoutPanel1.Controls.Add(this.groupBox2, 2, 0);
		this.tableLayoutPanel1.Controls.Add(this.groupBox3, 0, 0);
		this.tableLayoutPanel1.Controls.Add(this.groupBox1, 1, 0);
		this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
		this.tableLayoutPanel1.Name = "tableLayoutPanel1";
		this.tableLayoutPanel1.RowCount = 1;
		this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100f));
		this.tableLayoutPanel1.Size = new System.Drawing.Size(956, 293);
		this.tableLayoutPanel1.TabIndex = 0;
		this.groupBox2.Controls.Add((System.Windows.Forms.Control)(object)this.dgvRegions);
		this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
		this.groupBox2.Location = new System.Drawing.Point(639, 3);
		this.groupBox2.Name = "groupBox2";
		this.groupBox2.Size = new System.Drawing.Size(314, 287);
		this.groupBox2.TabIndex = 0;
		this.groupBox2.TabStop = false;
		this.groupBox2.Text = "积分区间";
		((System.Windows.Forms.DataGridView)(object)this.dgvRegions).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvRegions).AllowUserToDeleteRows = false;
		dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvRegions).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
		((System.Windows.Forms.DataGridView)(object)this.dgvRegions).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		((System.Windows.Forms.DataGridView)(object)this.dgvRegions).Columns.AddRange(this.colLabel, this.ColMains, this.colStart, this.colEnd, this.colReference);
		dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.dgvRegions).DefaultCellStyle = dataGridViewCellStyle2;
		((System.Windows.Forms.Control)(object)this.dgvRegions).Dock = System.Windows.Forms.DockStyle.Fill;
		this.dgvRegions.HorCopy = false;
		((System.Windows.Forms.Control)(object)this.dgvRegions).Location = new System.Drawing.Point(3, 17);
		((System.Windows.Forms.Control)(object)this.dgvRegions).Name = "dgvRegions";
		dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		((System.Windows.Forms.DataGridView)(object)this.dgvRegions).RowsDefaultCellStyle = dataGridViewCellStyle3;
		((System.Windows.Forms.DataGridView)(object)this.dgvRegions).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvRegions).Size = new System.Drawing.Size(308, 267);
		((System.Windows.Forms.Control)(object)this.dgvRegions).TabIndex = 0;
		this.dgvRegions.VerCopy = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvRegions).CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(dgvRegions_CellValueChanged);
		((System.Windows.Forms.DataGridView)(object)this.dgvRegions).DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(dgvRegions_DataError);
		((System.Windows.Forms.Control)(object)this.dgvRegions).MouseDown += new System.Windows.Forms.MouseEventHandler(dgvRegions_MouseDown);
		this.colLabel.DataPropertyName = "Label";
		this.colLabel.HeaderText = "标签";
		this.colLabel.Name = "colLabel";
		this.ColMains.DataPropertyName = "Mains";
		this.ColMains.HeaderText = "扫描次数";
		this.ColMains.Name = "ColMains";
		this.ColMains.ReadOnly = true;
		this.colStart.DataPropertyName = "Start";
		this.colStart.HeaderText = "起始";
		this.colStart.Name = "colStart";
		this.colEnd.DataPropertyName = "End";
		this.colEnd.HeaderText = "结束";
		this.colEnd.Name = "colEnd";
		this.colReference.DataPropertyName = "ReferenceId";
		this.colReference.HeaderText = "基底";
		this.colReference.Name = "colReference";
		this.colReference.Visible = false;
		this.groupBox3.Controls.Add(this.dgvPeak);
		this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
		this.groupBox3.Location = new System.Drawing.Point(3, 3);
		this.groupBox3.Name = "groupBox3";
		this.groupBox3.Size = new System.Drawing.Size(312, 287);
		this.groupBox3.TabIndex = 0;
		this.groupBox3.TabStop = false;
		this.groupBox3.Text = "扫描参数";
		this.dgvPeak.AllowUserToAddRows = false;
		this.dgvPeak.AllowUserToDeleteRows = false;
		this.dgvPeak.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		this.dgvPeak.Columns.AddRange(this.colSymbol, this.colDwell, this.colResolution);
		dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		this.dgvPeak.DefaultCellStyle = dataGridViewCellStyle4;
		this.dgvPeak.Dock = System.Windows.Forms.DockStyle.Fill;
		this.dgvPeak.Location = new System.Drawing.Point(3, 17);
		this.dgvPeak.Name = "dgvPeak";
		this.dgvPeak.RowTemplate.Height = 23;
		this.dgvPeak.Size = new System.Drawing.Size(306, 267);
		this.dgvPeak.TabIndex = 0;
		this.colSymbol.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colSymbol.DataPropertyName = "symbol";
		this.colSymbol.HeaderText = "元素";
		this.colSymbol.Name = "colSymbol";
		this.colDwell.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colDwell.DataPropertyName = "dwell";
		this.colDwell.HeaderText = "驻留时间";
		this.colDwell.Name = "colDwell";
		this.colResolution.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colResolution.DataPropertyName = "resolution";
		this.colResolution.HeaderText = "分辨率";
		this.colResolution.Name = "colResolution";
		this.groupBox1.Controls.Add(this.splitContainer3);
		this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.groupBox1.Location = new System.Drawing.Point(321, 3);
		this.groupBox1.Name = "groupBox1";
		this.groupBox1.Size = new System.Drawing.Size(312, 287);
		this.groupBox1.TabIndex = 0;
		this.groupBox1.TabStop = false;
		this.groupBox1.Text = "样品/元素";
		this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
		this.splitContainer3.Location = new System.Drawing.Point(3, 17);
		this.splitContainer3.Name = "splitContainer3";
		this.splitContainer3.Panel1.Controls.Add(this.treeView1);
		this.splitContainer3.Panel2.Controls.Add(this.pnlColor);
		this.splitContainer3.Size = new System.Drawing.Size(306, 267);
		this.splitContainer3.SplitterDistance = 217;
		this.splitContainer3.TabIndex = 0;
		this.treeView1.BackColor = System.Drawing.SystemColors.ControlLightLight;
		this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.treeView1.Location = new System.Drawing.Point(0, 0);
		this.treeView1.Name = "treeView1";
		this.treeView1.Size = new System.Drawing.Size(217, 267);
		this.treeView1.TabIndex = 1;
		this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(treeView1_AfterSelect);
		this.treeView1.MouseClick += new System.Windows.Forms.MouseEventHandler(treeView1_MouseClick);
		this.pnlColor.AutoScroll = true;
		this.pnlColor.Dock = System.Windows.Forms.DockStyle.Fill;
		this.pnlColor.Location = new System.Drawing.Point(0, 0);
		this.pnlColor.Name = "pnlColor";
		this.pnlColor.Size = new System.Drawing.Size(85, 267);
		this.pnlColor.TabIndex = 0;
		this.panel1.Controls.Add((System.Windows.Forms.Control)(object)this.dgvSample);
		this.panel1.Controls.Add(this.customGraph1);
		this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panel1.Location = new System.Drawing.Point(0, 0);
		this.panel1.Name = "panel1";
		this.panel1.Size = new System.Drawing.Size(956, 287);
		this.panel1.TabIndex = 0;
		((System.Windows.Forms.DataGridView)(object)this.dgvSample).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvSample).AllowUserToDeleteRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvSample).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		((System.Windows.Forms.DataGridView)(object)this.dgvSample).Columns.AddRange(this.dataGridViewTextBoxColumn19, this.dataGridViewTextBoxColumn20, this.colSweeps);
		dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.dgvSample).DefaultCellStyle = dataGridViewCellStyle5;
		this.dgvSample.HorCopy = false;
		((System.Windows.Forms.Control)(object)this.dgvSample).Location = new System.Drawing.Point(452, 49);
		((System.Windows.Forms.Control)(object)this.dgvSample).Name = "dgvSample";
		((System.Windows.Forms.DataGridView)(object)this.dgvSample).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvSample).Size = new System.Drawing.Size(306, 134);
		((System.Windows.Forms.Control)(object)this.dgvSample).TabIndex = 1;
		this.dgvSample.VerCopy = true;
		((System.Windows.Forms.Control)(object)this.dgvSample).Visible = false;
		this.dataGridViewTextBoxColumn19.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn19.DataPropertyName = "SampleName";
		this.dataGridViewTextBoxColumn19.HeaderText = "样品名称";
		this.dataGridViewTextBoxColumn19.Name = "dataGridViewTextBoxColumn19";
		this.dataGridViewTextBoxColumn20.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn20.DataPropertyName = "Time";
		this.dataGridViewTextBoxColumn20.HeaderText = "采样时间";
		this.dataGridViewTextBoxColumn20.Name = "dataGridViewTextBoxColumn20";
		this.colSweeps.DataPropertyName = "Sweeps";
		this.colSweeps.HeaderText = "叠加次数";
		this.colSweeps.Name = "colSweeps";
		this.customGraph1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.customGraph1.Location = new System.Drawing.Point(0, 0);
		this.customGraph1.Name = "customGraph1";
		this.customGraph1.ScrollGrace = 0.0;
		this.customGraph1.ScrollMaxX = 0.0;
		this.customGraph1.ScrollMaxY = 0.0;
		this.customGraph1.ScrollMaxY2 = 0.0;
		this.customGraph1.ScrollMinX = 0.0;
		this.customGraph1.ScrollMinY = 0.0;
		this.customGraph1.ScrollMinY2 = 0.0;
		this.customGraph1.Size = new System.Drawing.Size(956, 287);
		this.customGraph1.TabIndex = 1;
		this.customGraph1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(customGraph1_MouseDoubleClick);
		this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn1.DataPropertyName = "start";
		this.dataGridViewTextBoxColumn1.HeaderText = "起始值";
		this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
		this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn2.DataPropertyName = "end";
		this.dataGridViewTextBoxColumn2.HeaderText = "终止值";
		this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
		this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn3.DataPropertyName = "dwell";
		this.dataGridViewTextBoxColumn3.HeaderText = "驻留时间";
		this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
		this.dataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn4.DataPropertyName = "channels";
		this.dataGridViewTextBoxColumn4.HeaderText = "通道";
		this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
		this.dataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn5.DataPropertyName = "resolution";
		this.dataGridViewTextBoxColumn5.HeaderText = "分辨率";
		this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
		this.dataGridViewTextBoxColumn5.Resizable = System.Windows.Forms.DataGridViewTriState.True;
		this.dataGridViewTextBoxColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn6.DataPropertyName = "settings";
		this.dataGridViewTextBoxColumn6.HeaderText = "仪器设置";
		this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
		this.dataGridViewTextBoxColumn6.Resizable = System.Windows.Forms.DataGridViewTriState.True;
		this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn7.DataPropertyName = "start";
		this.dataGridViewTextBoxColumn7.HeaderText = "起始值";
		this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
		this.dataGridViewTextBoxColumn8.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn8.DataPropertyName = "end";
		this.dataGridViewTextBoxColumn8.HeaderText = "终止值";
		this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
		this.dataGridViewTextBoxColumn9.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn9.DataPropertyName = "dwell";
		this.dataGridViewTextBoxColumn9.HeaderText = "驻留时间";
		this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
		this.dataGridViewTextBoxColumn10.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn10.DataPropertyName = "channels";
		this.dataGridViewTextBoxColumn10.HeaderText = "通道";
		this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
		this.dataGridViewTextBoxColumn11.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn11.DataPropertyName = "resolution";
		this.dataGridViewTextBoxColumn11.HeaderText = "分辨率";
		this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
		this.dataGridViewTextBoxColumn12.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn12.DataPropertyName = "settings";
		this.dataGridViewTextBoxColumn12.HeaderText = "仪器设置";
		this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
		this.dataGridViewTextBoxColumn13.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn13.DataPropertyName = "symbol";
		this.dataGridViewTextBoxColumn13.HeaderText = "符号";
		this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13";
		this.dataGridViewTextBoxColumn13.ReadOnly = true;
		this.dataGridViewTextBoxColumn14.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn14.DataPropertyName = "dwell";
		this.dataGridViewTextBoxColumn14.HeaderText = "驻留时间";
		this.dataGridViewTextBoxColumn14.Name = "dataGridViewTextBoxColumn14";
		this.dataGridViewTextBoxColumn15.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn15.DataPropertyName = "channels";
		this.dataGridViewTextBoxColumn15.HeaderText = "通道";
		this.dataGridViewTextBoxColumn15.Name = "dataGridViewTextBoxColumn15";
		this.dataGridViewTextBoxColumn16.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn16.DataPropertyName = "separation";
		this.dataGridViewTextBoxColumn16.HeaderText = "AMU间隔";
		this.dataGridViewTextBoxColumn16.Name = "dataGridViewTextBoxColumn16";
		this.dataGridViewTextBoxColumn17.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn17.DataPropertyName = "resolution";
		this.dataGridViewTextBoxColumn17.HeaderText = "分辨率";
		this.dataGridViewTextBoxColumn17.Name = "dataGridViewTextBoxColumn17";
		this.dataGridViewTextBoxColumn18.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn18.DataPropertyName = "settings";
		this.dataGridViewTextBoxColumn18.HeaderText = "仪器设置";
		this.dataGridViewTextBoxColumn18.Name = "dataGridViewTextBoxColumn18";
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(956, 584);
		base.Controls.Add(this.splitContainer1);
		base.Name = "FormScan";
		base.ShowIcon = false;
		this.Text = "FormScan";
		base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormScan_FormClosing);
		base.Load += new System.EventHandler(FormScan_Load);
		this.splitContainer1.Panel1.ResumeLayout(false);
		this.splitContainer1.Panel2.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.splitContainer1).EndInit();
		this.splitContainer1.ResumeLayout(false);
		this.tableLayoutPanel1.ResumeLayout(false);
		this.groupBox2.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvRegions).EndInit();
		this.groupBox3.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvPeak).EndInit();
		this.groupBox1.ResumeLayout(false);
		this.splitContainer3.Panel1.ResumeLayout(false);
		this.splitContainer3.Panel2.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.splitContainer3).EndInit();
		this.splitContainer3.ResumeLayout(false);
		this.panel1.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvSample).EndInit();
		base.ResumeLayout(false);
	}
}
